//
//  DiagnosisAgainViewController.m
//  MobileChecker
//
//  Created by Lymons on 15-1-13.
//  Copyright (c) 2015年 Lymons. All rights reserved.
//

#import "DiagnosisAgainViewController.h"
#import "CheckAgainItemViewModel.h"

@interface DiagnosisAgainViewController ()

@property (nonatomic, strong) IBOutlet UITableView *tableView;
@property (nonatomic) CheckAgainItemViewModel *viewModel;

@end

@implementation DiagnosisAgainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.viewModel = [[CheckAgainItemViewModel alloc] init];
    self.viewModel.tableViewCellIdentifier = @"DiagnosisAgainTableViewCell";
    self.tableView.dataSource = self.viewModel;
    self.tableView.delegate = self;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - UITableViewDelegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *item = [self.viewModel.items objectAtIndex:indexPath.row];
    
    if ([item isEqualToString:CELL_CENSOR]) {
        [self performSegueWithIdentifier:@"SelfAutoDiagnosis" sender:self];
    } else if ([item isEqualToString:CELL_VIBRATION]) {
        [self performSegueWithIdentifier:@"SelfVibDiagnosis" sender:self];
    }if ([item isEqualToString:CELL_RECORD]) {
        [self performSegueWithIdentifier:@"SelfRecordDiagnosis" sender:self];
    }if ([item isEqualToString:CELL_SOUND]) {
        [self performSegueWithIdentifier:@"SelfSoundDiagnosis" sender:self];
    }if ([item isEqualToString:CELL_TOUCH]) {
        [self performSegueWithIdentifier:@"SelfTouchDiagnosis" sender:self];
    }if ([item isEqualToString:CELL_SCREEN]) {
        [self performSegueWithIdentifier:@"SelfScreenDiagnosis" sender:self];
    }if ([item isEqualToString:CELL_CAMERA]) {
        [self performSegueWithIdentifier:@"SelfCameraDiagnosis" sender:self];
    }
}

@end
